/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-09-19 14:52:17
 * @LastEditors: Aroma
 * @LastEditTime: 2024-09-19 15:19:23
 * @别瞎看: 你个无脑牛马
 */
class Test03Base{
    public static void main(String[] args) {
        //向上转型 子类对象指向父类引用
        Base base=new Derived();
        
        //访问成员变量
        System.out.println("base.n:"+base.n);
        // System.out.println("base.v:"+base.v);
        
        //访问成员方法
        base.show();
        // base.disp();

        //向下转型
        Derived d=(Derived)base;  
        //访问成员变量
        System.out.println("d.n:"+d.n);
        System.out.println("d.v:"+d.v);
        
        //向下转型
        Base base1=new Fork();
        Fork f=(Fork)base1;
        f.out();


        
    }
}